package com.auth.manager.pojo.sys;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * @version 1.0.0
 * @Date: 2022/4/28 20:39
 * @Author ZhuYouBin
 * @Description 权限实体
 */
@Data
@NoArgsConstructor
@TableName(value = "sys_menu")
public class SysMenu implements Serializable {

    /**
     * mid权限唯一标识
     */
    @TableId(type = IdType.AUTO)
    private Integer mid;

    /**
     * 父级id
     */
    @NotNull(message = "父级pid不能为空")
    @TableField(value = "pid")
    private Integer pid;

    /**
     * 菜单名称
     */
    @Size(min = 1, max = 30, message = "菜单名称长度不能超过30")
    @NotBlank(message = "菜单名称不能为空")
    @TableField(value = "menu_name")
    private String menuName;

    /**
     * 菜单类型(01目录02菜单03按钮)
     */
    @Size(max = 5, message = "菜单类型长度不能超过5")
    @TableField(value = "menu_type")
    private String menuType;

    /**
     * 请求地址
     */
    @Size(max = 100, message = "菜单类型长度不能超过100")
    @TableField(value = "url")
    private String url;

    /**
     * 是否显式(01显式02隐藏)
     */
    @Size(max = 5, message = "visible长度不能超过5")
    @TableField(value = "visible")
    private String visible;

    /**
     * 菜单图标
     */
    @Size(max = 50, message = "菜单图标长度不能超过50")
    @TableField(value = "menu_icon")
    private String menuIcon;

    /**
     * 组件路径
     */
    @Size(max = 100, message = "组件路径长度不能超过100")
    @TableField(value = "component")
    private String component;

    /**
     * 权限标识
     */
    @NotBlank(message = "权限标识不能为空")
    @Size(min = 1, max = 50, message = "权限标识长度不能超过50")
    @TableField(value = "menu_key")
    private String menuKey;

    /**
     * 删除标识(01未删除02已删除)
     */
    @TableField(value = "deleted")
    private String deleted;

    /**
     * 创建日期
     */
    @TableField(value = "create_time")
    private String createTime;

}
